//-----------------------------------------------------------------------
//<copyright file="DonViTinhBLL.cs
//Code gen by tool.
//</copyright>
//-----------------------------------------------------------------------
using System;
using PMS.Exceptions;
using System.Collections.Generic;
using PMS.DAL;
using PMS.Entity;

namespace PMS.BLL
{
	public class DonViTinhBO : BaseBO
	{
		// Interface Instant Object
		private readonly IDonViTinhDAO donvitinhInterfaceObject = null;

		// Constructor
		public DonViTinhBO()
		{
			donvitinhInterfaceObject = new DAL.ServiceFactory<IDonViTinhDAO>().CurrentDAL;
		}

		#region DonViTinh

		/// <summary>
		///
		/// </summary>
		/// <param name="donvitinh"></param>
		public DonViTinh CreateDonViTinh(DonViTinh donvitinh)
		{
			try
			{
				return donvitinhInterfaceObject.CreateDonViTinh(donvitinh);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access CreateDonViTinh Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="donvitinh"></param>
		public void UpdateDonViTinh(DonViTinh donvitinh)
		{
			try
			{
				donvitinhInterfaceObject.UpdateDonViTinh(donvitinh);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access UpdateDonViTinhException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="donvitinh"></param>
		public void DeleteDonViTinh(DonViTinh donvitinh)
		{
			try
			{
				donvitinhInterfaceObject.DeleteDonViTinh(donvitinh);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access DeleteDonViTinhException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		public DonViTinhs GetAllDonViTinh()
		{
			try
			{
				return donvitinhInterfaceObject.GetAllDonViTinh();
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetAllDonViTinh Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="maDonVi"></param>
		public DonViTinh GetDonViTinhByID(string maDonVi)
		{
			try
			{
				return donvitinhInterfaceObject.GetDonViTinhByID(maDonVi);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetDonViTinhBy ID Exception", ex);
			}
		}

		#endregion
	}
}
